package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * ClassName: UserMapper
 * Description: com.sky.mapper
 */
@Mapper
public interface UserMapper {

    /**
     * 查询用户
     * @param openid
     * @return
     */
    @Select("select * from user where openid = #{openid}")
    User getUserByOpenid(String openid);

    /**
     * 添加用户
     * @param user
     */
    void insert(User user);

    /**
     *
     * 查询用户
     * @param userId
     * @return
     */
    @Select("select * from user where id = #{userId}")
    User getById(Long userId);


    /**
     * 统计用户数量
     * @param map
     * @return
     */
    Integer countUser(Map map);
}
